Phase 0: Add backend infrastructure tracking#34
Merged
infinityabundance merged 7 commits intomainfrom Feb 13, 2026
Merged
Conversation
Co-authored-by: infinityabundance <255699974+infinityabundance@users.noreply.github.com>
Co-authored-by: infinityabundance <255699974+infinityabundance@users.noreply.github.com>
Co-authored-by: infinityabundance <255699974+infinityabundance@users.noreply.github.com>
Co-authored-by: infinityabundance <255699974+infinityabundance@users.noreply.github.com>
Co-authored-by: infinityabundance <255699974+infinityabundance@users.noreply.github.com>
Co-authored-by: infinityabundance <255699974+infinityabundance@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add backend tracking to context in rootstream
Phase 0: Add backend infrastructure tracking
Feb 13, 2026
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds minimal infrastructure for multi-backend fallback support. Tracks active backends (capture, encoder, audio, display, decoder) and displays status on startup. No behavioral changes—pure foundation for Phases 1-6.
Details
What changed?
Header (
include/rootstream.h)active_backendstruct tracking 6 backend types (capture, encoder, audio cap/play, decoder, display)backend_prefsstruct for override options and verbose modeTRY_INIT_BACKENDmacro for future fallback selection (unused in Phase 0)Core init (
src/core.c)CLI (
src/main.c)--backend-verboseflag (plumbing for future phases)Service layer (
src/service.c)active_backendfields after successful initializationRationale
Current fallback chains (DRM→X11→Dummy, NVENC→VA-API→FFmpeg→Raw) lack visibility. Users don't know which backend initialized. This adds zero-cost tracking (string pointers) and startup reporting, enabling:
--encoder=ffmpeg)Aligns with simplicity: no abstractions, just tracking what already exists.
Testing
Runtime testing requires full dependency chain (libsodium, SDL2, VA-API, etc.) not available in CI. Manual testing:
--backend-verboseflag acceptedNotes
Original prompt
PHASE 0: Backend Infrastructure Setup (Simplified)
Goal
Create the foundation for multi-fallback support by adding backend abstraction to the codebase. This is NOT a massive refactor—just the minimal infrastructure needed so Phases 1-6 can add fallback implementations cleanly.
Current State
service_run_host()andservice_run_client()Solution: Three Small Changes
Change 1: Add Backend Tracking to Context
In
include/rootstream.h, findtypedef struct rootstream_ctx_tand add:Change 2: Add Simple Fallback Selection Macro
In
include/rootstream.h, add:Change 3: Add Feature Detection to Context Init
In
src/core.c, in therootstream_init()function, add (near the end before return 0):Change 4: Add CLI Option for Backend Verbose Mode
In
src/main.c, in the option parsing section, add:Change 5: Update Service Startup Report
In
src/service.c, inservice_run_host(), after all initialization is complete (before main loop), add:And similar in
service_run_client():Implementation Steps
Edit
include/rootstream.h:active_backendstruct torootstream_ctx_tbackend_prefsstruct torootstream_ctx_tTRY_INIT_BACKENDmacroEdit
src/core.c:rootstream_init()Edit
src/main.c:--backend-verboseCLI optionEdit
src/service.c:service_run_host()to setctx->active_backend.capture_nameafter initservice_run_host()to setctx->active_backend.encoder_nameafter ...This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.